package cn.ffcs.uec.outStaffEncPunishTalentInputApply.component;

import java.io.FileInputStream;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import lombok.Getter;
import lombok.Setter;

import org.zkoss.util.media.Media;
import org.zkoss.web.servlet.Servlets;
import org.zkoss.zk.ui.Components;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.SuspendNotAllowedException;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.ForwardEvent;
import org.zkoss.zk.ui.event.UploadEvent;
import org.zkoss.zkplus.databind.BindingListModelList;
import org.zkoss.zul.Div;
import org.zkoss.zul.Filedownload;
import org.zkoss.zul.ListModel;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Messagebox;
import org.zkoss.zul.Window;

import cn.ffcs.raptornuke.plugin.common.zk.util.ZkUtil;
import cn.ffcs.uec.common.vo.UecBdDefdoc;
import cn.ffcs.uec.outStaff.constant.UecOutStaffConstants;
import cn.ffcs.uec.outStaff.model.UecOutStaffInfo;
import cn.ffcs.uec.outStaffEncPunishTalentInputApply.component.bean.UecOutStaffTalentInputListboxBean;
import cn.ffcs.uec.recordsApproval.util.ApprovalUtil;
import cn.ffcs.uec.staff.manager.UecTalentTeamManager;
import cn.ffcs.uec.staff.model.UecTalentTeam;
import cn.ffcs.uom.common.model.DefaultDaoFactory;
import cn.ffcs.uom.common.util.ApplicationContextUtil;
import cn.ffcs.uom.common.util.FileUtil;
import cn.ffcs.uom.common.util.IPortletInfoProvider;
import cn.ffcs.uom.common.util.ListboxUtils;
import cn.ffcs.uom.common.util.PlatformUtil;
import cn.ffcs.uom.common.util.StrUtil;
import cn.ffcs.uom.common.vo.NodeVo;
import cn.ffcs.uom.common.vo.PageInfo;
import cn.ffcs.uom.common.zul.PubUtil;

public class UecOutStaffTalentInputListboxExt extends Div implements IdSpace {

	private static final long serialVersionUID = -5175378301837516408L;

	/**
	 * 人员基本信息功能 查询出的实体对象
	 */
	private UecOutStaffInfo uecOutStaffInfo;
	/**
	 * 对应页面上的bean
	 */
	private UecOutStaffTalentInputListboxBean bean = new UecOutStaffTalentInputListboxBean();
	/**
	 * 专业人才队伍
	 */
	private UecTalentTeam uecTalentTeam;
	/**
	 * 上传文件
	 */
	private Media media;

	/**
	 * 存放上传数据
	 */
	private List<UecTalentTeam> talentTeams = new ArrayList<UecTalentTeam>();

	private static final int TOTAL_COLUMN = 15;

	private UecTalentTeamManager uecTalentTeamManager = (UecTalentTeamManager) ApplicationContextUtil
			.getBean("uecTalentTeamManager");

	public static final String UEC_OUT_STAFF_TALENT_INPUT_LISTBOX_EXT_ZUL = "/pages_nmg/outStaffEncPunishTalentInputApply/comp/uecOutstaffTalentInput_listbox_ext.zul";

	@Getter
	@Setter
	private IPortletInfoProvider portletInfoProvider;

	public UecOutStaffTalentInputListboxExt() {
		Executions.createComponents(UEC_OUT_STAFF_TALENT_INPUT_LISTBOX_EXT_ZUL,
				this, null);
		Components.wireVariables(this, bean);
		Components.addForwards(this, this, '$');

	}

	/**
	 * 初始化
	 */
	public void onCreate() {
		this.bandListbox();
		this.setButtonValid(false, false, false, false, false, false);
		this.setButtonVisible(false, false, false, false);
	}
	
	
	/**
	 * 人员信息查询按钮
	 * 
	 * @throws Exception
	 */
	public void onQuery() throws Exception {

		clearVariable();
		if (!StrUtil.isNullOrEmpty(bean.getCondition().getSelectedItem().getValue())
				&& !StrUtil.isNullOrEmpty(bean.getConditionValue().getValue())) {
			Listbox listbox = bean.getCondition();
			String listboxStr = (String) listbox.getSelectedItem().getValue();
			int listboxId = Integer.parseInt(listboxStr);
			uecOutStaffInfo = UecOutStaffInfo.newInstance();
			switch (listboxId) {
			case 0:
				uecOutStaffInfo.setPsnName(bean.getConditionValue().getValue());
				break;
			case 1:
				uecOutStaffInfo.setPsnCode(bean.getConditionValue().getValue());
				break;
			case 2:
				uecOutStaffInfo.setIdNum(bean.getConditionValue().getValue());
				break;
			default:
				break;
			}
		}
		outStaffList();
	}
	
	/**
	 * 员工列表
	 * 
	 * @throws Exception
	 * @throws SuspendNotAllowedException
	 */
	public void outStaffList() throws SuspendNotAllowedException, Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("opType", "outStaffList");
		map.put("qryUecOutStaffInfo", uecOutStaffInfo);
		Window window = (Window) Executions.createComponents(UecOutStaffConstants.UEC_OUT_STAFF_LIST_ZUL, this, map);
		window.doModal();
		window.addEventListener("onOK", new EventListener() {
			@Override
			public void onEvent(Event event) throws Exception {
				if (event.getData() != null) {
					uecOutStaffInfo = (UecOutStaffInfo) event.getData();
					
					if (null != uecOutStaffInfo) {
						uecTalentTeam = new UecTalentTeam();
						if (!StrUtil.isNullOrEmpty(uecOutStaffInfo.getPkPsnMsg())
								&& !StrUtil.isNullOrEmpty(uecOutStaffInfo.getOutStaffId())) {
							uecTalentTeam.setPkPsndoc(uecOutStaffInfo.getPkPsnMsg());
							setButtonValid(true, true, true, false, false, false);
						} else {
							uecTalentTeam.setStaffId(uecOutStaffInfo.getOutStaffId());
							setButtonValid(true, true, true, true, true, true);
						}
						onQueryUecTalentTeam();
					}
				}
			}
		});
	}

	/**
	 * 选择一条记录
	 * 
	 * @throws Exception
	 */
	public void onSelectUecTalentTeamList() throws Exception {
		if (this.bean.getUecOutStaffTalentInputListbox().getSelectedCount() > 0) {
			uecTalentTeam = (UecTalentTeam) bean.getUecOutStaffTalentInputListbox()
					.getSelectedItem().getValue();
		}
	}


	/**
	 * 设置按钮 可用
	 * 
	 * @param canAdd
	 * @param candel
	 */
	private void setButtonValid(boolean canDownload, boolean canUpload,
			boolean canView, boolean canAdd, boolean canEdit, boolean candel) {
		this.bean.getViewButton().setDisabled(!canView);
		this.bean.getAddButton().setDisabled(!canAdd);
		this.bean.getEditButton().setDisabled(!canEdit);
		this.bean.getDelButton().setDisabled(!candel);

		this.bean.getDownloadButton().setDisabled(!canDownload);
		this.bean.getUploadButton().setDisabled(!canUpload);
	}
	
	private void setButtonVisible(boolean canView, boolean canAdd, boolean canEdit, boolean candel) {
		this.bean.getViewButton().setVisible(canView);
		this.bean.getAddButton().setVisible(canAdd);
		this.bean.getEditButton().setVisible(canEdit);
		this.bean.getDelButton().setVisible(candel);
	}

	/**
	 * 查询专业人才队伍
	 */
	public void onQueryUecTalentTeam() {
		this.bean.getUecOutStaffTalentInputListboxPaging().setActivePage(0);
		this.onQueryUecTalentTeamList();
	}

	/**
	 * 重置按钮
	 */
	public void onReset() {
		cn.ffcs.uom.common.util.PubUtil.clearComponent(this);
	}

	/**
	 * 下载模版
	 */
	@SuppressWarnings("deprecation")
	public void onDownloadTemplate() {
		try {
			String charset = "UTF-8";
			// 服务器文件名
			String fileName = "uecOutStaffTalentTeam_template.xls";
			// 编码后文件名
			String encodedName = null;
			encodedName = URLEncoder.encode(fileName, charset);
			// 将空格替换为+号
			encodedName = encodedName.replace("%20", "+");
			HttpServletRequest httpRequest = (HttpServletRequest) Executions
					.getCurrent().getNativeRequest();
			// 解决ie6 bug 或者是火狐浏览器
			if (encodedName.length() > 150 || Servlets.isGecko(httpRequest)
					|| Servlets.isGecko3(httpRequest)) {
				encodedName = new String(fileName.getBytes(charset),
						"ISO8859-1");
			}
			Filedownload.save(
					new FileInputStream(httpRequest
							.getRealPath("/pages_nmg/uec_outStaff/doc/"
									+ fileName)), "application/octet-stream",
					encodedName);
		} catch (Exception e) {
			ZkUtil.showError("下载员工奖励信息导入模版失败。", "系统提示");
		}
	}

	/**
	 * 文件上传 导入员工
	 * 
	 * @param event
	 * @throws Exception
	 */
	public void onUpload$uploadButton(final ForwardEvent forwardEvent)
			throws Exception {

		Messagebox.show("确认批量导入文件？导入后将直接发起流程！", "输入确认", Messagebox.OK
				| Messagebox.CANCEL, Messagebox.QUESTION, new EventListener() {
			@Override
			public void onEvent(Event event) throws Exception {
				if (((Integer) event.getData()).intValue() == Messagebox.OK) {
					bean.getUecOutStaffTalentInputListbox().clearSelection();

					media = ((UploadEvent) forwardEvent.getOrigin()).getMedia();
					if (null == media) {
						ZkUtil.showError("请选择要上传的文件!", "系统提示");
						return;
					}
					String fileName = media.getName();
					if (fileName.endsWith(".xls") || fileName.endsWith(".xlsx")) {
						// readsUpLoadFile();
					} else {
						ZkUtil.showError("导入的文件必须是以.xls或.xlsx结尾的EXCEL文件!",
								"系统提示");
						return;
					}
					String[][] objArray = FileUtil.readExcel(media, 1, 1);
					if (objArray == null || objArray.length == 0) {
						ZkUtil.showError("导入文件没有数据！", "错误信息");
						return;
					}
					setDataToRows(objArray, fileName);
				} else {
					return;
				}
			}
		});

	}

	private void setDataToRows(String[][] data, String fileName) throws Exception {

		talentTeams.clear();
		String[] row = null;
		boolean isUpload = true;
		for (int i = 0; i < data.length; i++) {
			row = data[i];
			if (row.length < TOTAL_COLUMN) {
				ZkUtil.showError("导入文件数据不全！", "错误信息");
				return;
			}

			UecTalentTeam talentTeam = UecTalentTeam.newInstance();
			for (int j = 0; j < TOTAL_COLUMN; j++) {

				switch (j) {
				// 专业人才名称
				case 0:
					if (null == data[i][j]) {
						ZkUtil.showError("专业人才名称为空！", "错误提示");
						isUpload = false;
						return;
					}
					StringBuilder sBuilder = new StringBuilder(
							" WITH TB_S AS "
									+ " (SELECT T0.MONTH_ID,T0.PK_DEFDOC, T0.NAME, T0.PK_DEFDOCLIST FROM LDAPM_MPW_BD_DEFDOC T0) "
									+ " SELECT "
									+ " DISTINCT "
									+ "  T7.NAME ,"
									+ "  T7.PK_DEFDOC "
									+ "  FROM LDAPM_MPW_HI_PSNDOC_GLBDEF6 JA1 "
									+ "  LEFT JOIN TB_S T7 "
									+ "  ON (JA1.GLBDEF1 = T7.PK_DEFDOC AND JA1.MONTH_ID = T7.MONTH_ID) "
									+ "  where JA1.MONTH_ID = 201805 and T7.NAME = ? ");
					List<Object> params = new ArrayList<Object>();
					params.add(data[i][j]);
					UecBdDefdoc bdDefdoc = DefaultDaoFactory.getDefaultDao()
							.jdbcFindObject(sBuilder.toString(), params,
									UecBdDefdoc.class);
					talentTeam.setGlbdef1(bdDefdoc.getPkDefdoc());
					break;
				// 专业人才等级
				case 1:
					if (null == data[i][j]) {
						ZkUtil.showError("专业人才等级为空！", "错误提示");
						isUpload = false;
						return;
					}
					String glbdef2 = null;
					if("B级".equals(data[i][j])) {
						glbdef2 = "1001A1100000000006OU";
					}
					if("C级".equals(data[i][j])) {
						glbdef2 = "1001A1100000000006OT	";
					}
					if("D级".equals(data[i][j])) {
						glbdef2 = "1001A1100000000006OS";
					}
					talentTeam.setGlbdef2(glbdef2);
					break;
				// 专业工作年度考核结果
				case 2:
					if (null == data[i][j]) {
						ZkUtil.showError("专业工作年度考核结果为空！", "错误提示");
						isUpload = false;
						return;
					}
					String glbdef3 = null;
					if("称职".equals(data[i][j])) {
						glbdef3 = "1001A11000000000061K";
					}
					if("优秀".equals(data[i][j])) {
						glbdef3 = "1001A11000000000061J";
					}
					talentTeam.setGlbdef3(glbdef3);
					break;
				// 专家津贴金额
				case 3:
					if(null != data[i][j]) {
						try {
							Long.parseLong(data[i][j]);
						} catch (NumberFormatException e) {
							ZkUtil.showError("专家津贴格式不正确！", "错误提示");
							isUpload = false;
							e.printStackTrace();
							return;
						}
					}
					talentTeam.setGlbdef4(data[i][j]);
					break;
				// 特殊年金金额
				case 4:
					if(null != data[i][j]) {
						try {
							Long.parseLong(data[i][j]);
						} catch (NumberFormatException e) {
							ZkUtil.showError("特殊年金金额格式不正确！", "错误提示");
							isUpload = false;
							e.printStackTrace();
							return;
						}
					}
					talentTeam.setGlbdef5(data[i][j]);
					break;
				// 股票增值权
				case 5:
					talentTeam.setGlbdef6(data[i][j]);
					break;
				//开始时间
				case 6:
					if (null == data[i][j]) {
						ZkUtil.showError("开始时间为空！", "错误提示");
						isUpload = false;
						return;
					}
					try {
						new SimpleDateFormat("yyyy-MM-dd").parse(data[i][j]);
					} catch (ParseException e) {
							ZkUtil.showError("开始时间格式不正确！", "错误提示");
							isUpload = false;
							e.printStackTrace();
							return;
					}
					talentTeam.setBegindate(data[i][j]);
					break;	
				// 人才类型
				case 7:
					if (null == data[i][j]) {
						ZkUtil.showError("人才类型为空！", "错误提示");
						isUpload = false;
						return;
					}
					if ("实操".equals(data[i][i])) {
						talentTeam.setGlbdef10("1");
					}else {
						talentTeam.setGlbdef10("2");
					}
					break;
				//第一年考核
				case 8:
					talentTeam.setGlbdef11(data[i][j]);
					break;
				//第二年考核
				case 9:
					talentTeam.setGlbdef12(data[i][j]);
					break;
				//聘任状态
				case 10:
					if (null == data[i][j]) {
						ZkUtil.showError("聘任状态为空！", "错误提示");
						isUpload = false;
						return;
					}
					if ("在聘".equals(data[i][i])) {
						talentTeam.setGlbdef13("1001A1100000001SVL1S");
					}
					if ("退出".equals(data[i][i])) {
						talentTeam.setGlbdef13("1001A1100000001SVL1T");
					}
					break;
				//退出时间
				case 11:
					if (null == data[i][j]) {
						ZkUtil.showError("退出时间为空！", "错误提示");
						isUpload = false;
						return;
					}
					try {
						new SimpleDateFormat("yyyy-MM-dd").parse(data[i][j]);
					} catch (ParseException e) {
							ZkUtil.showError("退出时间格式不正确！", "错误提示");
							isUpload = false;
							e.printStackTrace();
							return;
					}
					talentTeam.setGlbdef14(data[i][j]);
					break;
				//退出原因
				case 12:
					talentTeam.setGlbdef15(data[i][j]);
					break;
				//子专业
				case 13:
					if (null == data[i][j]) {
						ZkUtil.showError("子专业为空！", "错误提示");
						isUpload = false;
						return;
					}
					StringBuilder builder = new StringBuilder(
							" WITH TB_S AS "
									+ " (SELECT T0.MONTH_ID,T0.PK_DEFDOC, T0.NAME, T0.PK_DEFDOCLIST FROM LDAPM_MPW_BD_DEFDOC T0) "
									+ " SELECT "
									+ " DISTINCT "
									+ "  T7.NAME ,"
									+ "  T7.PK_DEFDOC "
									+ "  FROM LDAPM_MPW_HI_PSNDOC_GLBDEF6 JA1 "
									+ "  LEFT JOIN TB_S T7 "
									+ "  ON (JA1.GLBDEF9 = T7.PK_DEFDOC AND JA1.MONTH_ID = T7.MONTH_ID) "
									+ "  where JA1.MONTH_ID = 201805 and T7.NAME = ? ");
					params = new ArrayList<Object>();
					params.add(data[i][j]);
					bdDefdoc = DefaultDaoFactory.getDefaultDao()
							.jdbcFindObject(builder.toString(), params,
									UecBdDefdoc.class);
					talentTeam.setGlbdef9(bdDefdoc.getPkDefdoc());
					break;
				//是否生效
				case 14:
					if (null == data[i][j]) {
						ZkUtil.showError("是否生效为空！", "错误提示");
						isUpload = false;
						return;
					}
					if("是".equals(data[i][j])) {
						talentTeam.setGlbdef8("Y");
					}
					if("否".equals(data[i][j])) {
						talentTeam.setGlbdef8("N");
					}
					break;
				default:
					break;
				}

			}
			if (!isUpload) {
				return;
			}

			talentTeam.setStaffId(uecOutStaffInfo.getOutStaffId());
			if (StrUtil.isNullOrEmpty(PlatformUtil.getCurrentUser())) {
				ZkUtil.showError("当前用户不存在！", "错误提示");
				return;
			}
			talentTeam.setCreator(PlatformUtil.getCurrentUser().getScreenName());
			talentTeam.setCreationtime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
			
			talentTeam.setDr(0L);
			talentTeam.setLastflag("Y");

			talentTeams.add(uecTalentTeam);
		}

		if (null != talentTeams) {
			ListModel list = new BindingListModelList(talentTeams, true);
			this.bean.getUecOutStaffTalentInputListbox().setModel(list);
			this.bean.getUecOutStaffTalentInputListboxPaging().setTotalSize(
					talentTeams.size());

			for (UecTalentTeam talentTeam : talentTeams) {

				talentTeam.addOnly();

				String startFlowJson = "{"
						+ "formTheme: '专业人才队伍申请流程',"
						+ " formContent: '专业人才:wangyiren',"
						+ " procDefId: 'outStaffTalentTeamEdit:1:bf6f02a207074f80b9b4dd4a6db3d10a',"
						+ " urgent: '1'," + " atiActCategoryId: '21',"
						+ " procDefKey: '" + ApprovalUtil.OUT_STAFF_TALENT_TEAM_EDIT
						+ "'," + " primaryId: " + uecTalentTeam.getTalentTeamId() + "}";
				 String procInstId =
				 ApprovalUtil.startApproval(startFlowJson);

				// 第一审批人如果是发起人直接到人力审批环节
				 ApprovalUtil.isCurrentAssignNames(procInstId);

			}
		}

		ZkUtil.showInformation("专业人才队伍申请流程批量发起", "温馨提示");
	}

	/**
	 * 查看按钮
	 * 
	 * @throws Exception
	 * @throws InterruptedException
	 */
	public void onViewUecTalentTeam() throws Exception, InterruptedException {
		if (uecTalentTeam != null && null != uecTalentTeam.getId()) {
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("opType", "view");
			map.put("uecTalentTeam", uecTalentTeam);
			Window window = (Window) Executions.createComponents(
					UecOutStaffConstants.UEC_OUT_STAFF_TALANTTEAM_EDIT_ZUL,
					this, map);
			window.doModal();
			window.addEventListener("onOK", new EventListener() {
				@Override
				public void onEvent(Event event) throws Exception {
					if (event.getData() != null) {
						//
					}
				}
			});
		} else {
			ZkUtil.showError("请选中要查看的记录", "提示信息");
		}
	}

	/**
	 * 新增按钮
	 * 
	 * @throws Exception
	 * @throws
	 */
	public void onAddUecTalentTeam() throws Exception {
		if (null != uecOutStaffInfo) {
			if (!StrUtil.isNullOrEmpty(uecOutStaffInfo.getPkPsnMsg())
					&& !StrUtil.isNullOrEmpty(uecOutStaffInfo.getOutStaffId())) {
				ZkUtil.showError("集团下发数据，禁止操作！", "温馨提示");
			} else {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("opType", "add");
				map.put("uecOutStaffInfo", uecOutStaffInfo);
				Window window = (Window) Executions.createComponents(
						UecOutStaffConstants.UEC_OUT_STAFF_TALANTTEAM_EDIT_ZUL,
						this, map);
				window.doModal();
				window.addEventListener("onOK", new EventListener() {
					@Override
					public void onEvent(Event event) throws Exception {
						if (event.getData() != null) {
							// 新增或修改完成后，列表从数据库更新
							uecTalentTeam = (UecTalentTeam) event.getData();
							onQueryUecTalentTeamList();
						}
					}
				});
			}
		}
	}

	/**
	 * 编辑按钮
	 * 
	 * @throws Exception
	 * @throws InterruptedException
	 */
	public void onEditUecTalentTeam() throws Exception, InterruptedException {
		if (uecTalentTeam != null && null != uecTalentTeam.getId()) {
			if (!StrUtil.isNullOrEmpty(uecOutStaffInfo.getPkPsnMsg())
					&& !StrUtil.isNullOrEmpty(uecOutStaffInfo.getOutStaffId())) {
				ZkUtil.showError("集团下发数据，禁止操作！", "温馨提示");
			} else {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("opType", "edit");
				map.put("uecTalentTeam", uecTalentTeam);
				Window window = (Window) Executions.createComponents(
						UecOutStaffConstants.UEC_OUT_STAFF_TALANTTEAM_EDIT_ZUL,
						this, map);
				window.doModal();
				window.addEventListener("onOK", new EventListener() {
					@Override
					public void onEvent(Event event) throws Exception {
						if (event.getData() != null) {
							// 新增或修改完成后，列表从数据库更新
							uecTalentTeam = (UecTalentTeam) event.getData();
							onQueryUecTalentTeamList();
						}
					}
				});
			}
		} else {
			ZkUtil.showError("请选择要编辑的记录", "提示信息");
			return;
		}
	}

	/**
	 * 删除按钮
	 */
	public void onDelUecTalentTeam() {
		if (this.uecTalentTeam != null && uecOutStaffInfo != null) {
			if (!StrUtil.isNullOrEmpty(uecOutStaffInfo.getPkPsnMsg())
					&& !StrUtil.isNullOrEmpty(uecOutStaffInfo.getOutStaffId())) {
				ZkUtil.showError("集团下发数据，禁止操作！", "温馨提示");
			} else {
				ZkUtil.showQuestion("确定要删除吗?", "提示信息", new EventListener() {
					public void onEvent(Event event) throws Exception {
						Integer result = (Integer) event.getData();
						if (result == Messagebox.OK) {
							uecTalentTeam.removeOnly();
							PubUtil.reDisplayListbox(
									bean.getUecOutStaffTalentInputListbox(),
									uecTalentTeam, "del");
							uecTalentTeam = null;
						}
					}
				});
			}
		} else {
			ZkUtil.showError("请选择你要删除的记录", "提示信息");
			return;
		}
	}

	/**
	 * 翻页
	 */
	public void onUecTalentTeamListboxPaging() {
		this.onQueryUecTalentTeamList();
	}

	/**
	 * 清除变量
	 */
	public void clearVariable() {
		uecTalentTeam = null;
	}

	/**
	 * 查询
	 */
	public void onQueryUecTalentTeamList() {
		if (null != uecTalentTeam) {
			PageInfo pageInfo = uecTalentTeamManager
					.queryPageInfoByUecTalentTeam(uecTalentTeam,
							this.bean.getUecOutStaffTalentInputListboxPaging()
									.getActivePage() + 1, this.bean
									.getUecOutStaffTalentInputListboxPaging()
									.getPageSize());
			ListModel list = new BindingListModelList(pageInfo.getDataList(),
					true);
			this.bean.getUecOutStaffTalentInputListbox().setModel(list);
			this.bean.getUecOutStaffTalentInputListboxPaging().setTotalSize(
					pageInfo.getTotalCount());
		}
	}
	
	/**
	 * 绑定下拉框
	 */
	public void bandListbox() {
		// 绑定下拉框
		List<NodeVo> nodeVoList = new ArrayList<NodeVo>();
		String[][] option = { { "0", "人员姓名" }, { "1", "人员编码" }, { "2", "证件号码" } };
		for (int i = 0; i < option.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(option[i][j]);
				nodeVo.setName(option[i][j + 1]);
			}
			nodeVoList.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getCondition(), nodeVoList);

	}

}
